package me.nujoug.net.dao;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Hospital implements WebParseObject{
    
	private String ID;
	private String name;
	private String desc1;
	private String desc2;
	private String notification;
	private String Level;
	private String District;
	private String category;
	private String appUrl;
	
	public String getAppUrl() {
		return appUrl;
	}
	public void setAppUrl(String appUrl) {
		this.appUrl = appUrl;
	}
	public String getID() {
		return ID;
	}
	public void setID(String iD) {
		ID = iD;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getDesc1() {
		return desc1;
	}
	public void setDesc1(String desc1) {
		this.desc1 = desc1;
	}
	public String getDesc2() {
		return desc2;
	}
	public void setDesc2(String desc2) {
		this.desc2 = desc2;
	}
	public String getNotification() {
		return notification;
	}
	public void setNotification(String notification) {
		this.notification = notification;
	}
	public String getLevel() {
		return Level;
	}
	public void setLevel(String level) {
		Level = level;
	}
	public String getDistrict() {
		return District;
	}
	public void setDistrict(String district) {
		District = district;
	}
	public String getCategory() {
		return category;
	}
	public void setCategory(String category) {
		this.category = category;
	}

	@Override
	public boolean parseContent(String rawHtml) {
//		String subText = Utils.getSubString(rawHtml, 
//				"<div class=\"yy_content\">", 
//				"<div class='page'>");
//		
		String pattern = "<strong><a href='/comm/yyks-(\\d+).html'>([^<]+)</a></strong>\\s+<span>(.+?)</span>";
	    Matcher m = Pattern.compile(pattern).matcher(rawHtml);
	    if (m.find()) {
	    	ID = m.group(1);
	        name =  m.group(2);
	        desc1 = m.group(3).replace("<br />", "\n");
	        return true;
	    }
		return false;
	}
}

